package com.konne.nightmare.FastPublicOpinion.http;

import com.blankj.utilcode.util.ApiUtils;
import com.konne.nightmare.FastPublicOpinion.bean.CurrencyBean;
import com.konne.nightmare.FastPublicOpinion.bean.EditEventBean;
import com.konne.nightmare.FastPublicOpinion.bean.EventBean;
import com.konne.nightmare.FastPublicOpinion.bean.HomeBean;
import com.konne.nightmare.FastPublicOpinion.bean.LoginBean;
import com.konne.nightmare.FastPublicOpinion.bean.NearbyActivityBean;
import com.konne.nightmare.FastPublicOpinion.bean.OpinionDataBean;
import com.konne.nightmare.FastPublicOpinion.bean.OpinionDetailDataBean;
import com.konne.nightmare.FastPublicOpinion.bean.OrganizationIdPermissionBean;
import com.konne.nightmare.FastPublicOpinion.bean.SelectNearbyBean;
import com.konne.nightmare.FastPublicOpinion.bean.UserInfoBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * @author a_Bin
 * 描述：
 * 创建日期：2021/3/14
 */
public interface ApiService {


    String BASE_URL = Config.getOpenApi();

    //网络请求时长
    int HTTP_TIME = 60;


    /**
     * 获取系统的部分权限
     *
     * @param organizationId id
     * @return {@link OrganizationIdPermissionBean.ResponseDataBean}
     */
    @GET("organization/organization/getInfo")
    Observable<BaseResponse<OrganizationIdPermissionBean.ResponseDataBean>> getOrganPermission(
            @Query(value = "organizationId", encoded = true) int organizationId);

    /**
     * app激活账号
     */
    @POST("web/filter/activation")
    Observable<BaseResponse<CurrencyBean>> activation(@Body RequestBody body);

    /**
     * app登录接口
     */
    @POST("web/filter/login")
    Observable<BaseResponse<LoginBean.DataBean>> login(@Body RequestBody body);

    /**
     * 通过手机号获取激活验证码
     */
    @POST("web/filter/getPhoneActivationMsg")
    Observable<BaseResponse<CurrencyBean>> getPhoneActivationMsg(@Body RequestBody body);

    /**
     * app扫码允许接口
     */
    @POST("web/sysUser/appAllow")
    Observable<BaseResponse<CurrencyBean>> appAllow(@Body RequestBody body);

    /**
     * 事件分析列表
     */
    @POST("web/eventPlan/selectEventPlanList")
    Observable<BaseResponse<List<EventBean.RowsBean>>> selectEventPlanList(@Body RequestBody body);

    /**
     * 手动修改事件状态功能
     */
    @POST("web/eventPlan/updateEventPlan")
    Observable<BaseResponse<String>> updateEventPlan(@Body RequestBody body);

    /**
     * 查询事件信息
     */
    @GET("web/eventPlan/selectEventPlanInfo")
    Observable<BaseResponse<EditEventBean.DataBean>> selectEventPlanInfo(@Query("eventId") int eventId);


    /**
     * 新增事件
     */
    @POST("web/eventPlan/save")
    Observable<BaseResponse<String>> save(@Body RequestBody body);

    /**
     * 删除事件
     */
    @POST("web/eventPlan/delete")
    Observable<BaseResponse<String>> delete(@Body RequestBody body);

    /**
     * 综合分析
     */
    @POST("web/eventPlanData/selectComprehensiveAnalysis")
    Observable<BaseResponse<List<SelectNearbyBean.DataBean>>> selectComprehensiveAnalysis(@Body RequestBody body);


    /**
     * 事件首发媒体查询数据
     */
    @GET("web/eventPlanData/selectTheStarting")
    Observable<BaseResponse<List<NearbyActivityBean.RowsBean>>> selectTheStarting(@Query("eventId") int eventId);

    /**
     * 编辑事件保存
     */
    @POST("web/eventPlan/update")
    Observable<BaseResponse<String>> update(@Body RequestBody body);


    /**
     * 当前登录人信息
     */
    @GET("web/sysUser/getInfo")
    Observable<BaseResponse<UserInfoBean.DataBean>> getInfo();

    /**
     * 意见反馈
     */
    @POST("web/sysfeedback")
    Observable<BaseResponse<String>> sysfeedback(@Body RequestBody body);

    /**
     * 首页预警分页查询
     */
    @GET("web/jcDataManage/myWarning")
    Observable<BaseResponse<List<HomeBean.RowsBean>>> myWarning(
            @Query("pageNum") int pageNum,
            @Query("pageSize") int pageSize);

    //---------------------------------------------------Opinion------------------------------------

    //孙添财添加--------舆情列表接口
    @POST("web/jcDataManage/list")
    Observable<BaseResponse<List<OpinionDataBean.ResponseDataBean>>> postOpinionList(
            @Query("pageNum") int pageNum,
            @Query("pageSize") int pageSize,
            @Body RequestBody body);


    /**
     * 舆情详情接口
     */
    @GET("web/jcDataManage/info/")
    Observable<BaseResponse<OpinionDetailDataBean.ResponseDataBean>> getOpinionDetail();


    /**
     * 加入舆情收藏
     */
    @POST("web/jcDataManage/setIsCollect")
    Observable<BaseResponse<String>> postOpinionAddCollect(@Body RequestBody body);


    /**
     * 取消舆情收藏
     */
    @POST("web/jcDataManage/setIsNoCollect")
    Observable<BaseResponse<String>> postOpinionCancelCollect(@Body RequestBody body);

    /**
     * 设置预警
     */
    @POST("web/jcDataManage/setIsWarning")
    Observable<BaseResponse<String>> postOpinionAddWarning(@Body RequestBody body);

    /**
     * 取消预警
     */
    @POST("web/jcDataManage/setIsNoWarning")
    Observable<BaseResponse<String>> postOpinionCancelWarning(@Body RequestBody body);

    /**
     * 设置简报
     */
    @POST("web/jcDataManage/setIsJoinBriefing")
    Observable<BaseResponse<String>> postOpinionAddBriefing(@Body RequestBody body);

    /**
     * 取消简报
     */
    @POST("web/jcDataManage/setIsNoJoinBriefing")
    Observable<BaseResponse<String>> postOpinionCancelBriefing(@Body RequestBody body);

    /**
     * 删除舆情
     */
    @POST("web/jcDataManage/delete")
    Observable<BaseResponse<String>> postOpinionDelete(@Body RequestBody body);

    /**
     * 舆情看板
     * @param body
     * @return
     */
    @POST("web/jcDataManage/dataCount")
    Observable<BaseResponse<OpinionDataBean.ResponseStatisticalDataBean>> postOpinionDataStatistics(@Body RequestBody body);
}